﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleSurvival.src
{
    //-----------------------------------------------//
    //CLASS - State.cs
    //-----------------------------------------------//
    //Game.cs uses states in its state machine
    public interface IState
    {
        Game Game { get; }
        void LoadContent();
        void Draw(double dt);
        void Update(double dt);
        bool IsTransparent { set; get; }    //properties
        bool IsPaused { set; get; }
        bool IsLoaded { set; get; }
    }

    //Game state and Intro state extend this
    //Provise basic functionality
    public abstract class State : IState
    {
        bool _isLoaded = false;       //Has content been loaded
        Game _game = null;             

        public bool IsLoaded
        {
            get { return _isLoaded; }
            set { _isLoaded = value; }
        }

        public Game Game {get{return _game;}}

        bool _isPaused = true;       //Stops the state from updating

        public bool IsPaused
        {
            get { return _isPaused; }
            set { _isPaused = value; }
        }
        bool _isTransparent = false;  //Allows multiple states to be used simultaneosly

        public bool IsTransparent
        {
            get { return _isTransparent; }
            set { _isTransparent = value; }
        }

        public State(Game g) { _game = g; }

        //To all be overriden by children states.
        public virtual void LoadContent(){_isLoaded = true;}
        public virtual void Draw(double dt){}
        public virtual void Update(double dt){ }
    }

}
